<template>
  <div class="th-loading-round-rot" ref="thLoadingRoundDot">
    <span
      :style="[{ backgroundColor: color }]"
      v-for="item in 8"
      :key="item"
    ></span>
  </div>
</template>

<script>
export default {
  name: "thLoadingRoundDot",
  props: {
    color: String,
  },
};
</script>

<style scoped lang="scss">
.th-loading-round-rot {
  width: 70rpx;
  height: 70rpx;
  position: relative;
  margin: 0 auto;
  display: inline-block !important;
  & span {
    width: 0.4em;
    height: 0.4em;
    border-radius: 50%;
    position: absolute;
    -webkit-animation: load 1.04s ease infinite;
  }
  & span:nth-child(1) {
    left: 0;
    top: 50%;
    margin-top: -0.25em;
    -webkit-animation-delay: 0.13s;
  }
  & span:nth-child(2) {
    left: 0.25em;
    top: 0.25em;
    -webkit-animation-delay: 0.26s;
  }
  & span:nth-child(3) {
    left: 50%;
    top: 0;
    margin-left: -0.25em;
    -webkit-animation-delay: 0.39s;
  }
  & span:nth-child(4) {
    top: 0.25em;
    right: 0.25em;
    -webkit-animation-delay: 0.52s;
  }
  & span:nth-child(5) {
    right: 0;
    top: 50%;
    margin-top: -0.25em;
    -webkit-animation-delay: 0.65s;
  }
  & span:nth-child(6) {
    right: 0.25em;
    bottom: 0.25em;
    -webkit-animation-delay: 0.78s;
  }
  & span:nth-child(7) {
    bottom: 0;
    left: 50%;
    margin-left: -0.25em;
    -webkit-animation-delay: 0.91s;
  }
  & span:nth-child(8) {
    bottom: 0.25em;
    left: 0.25em;
    -webkit-animation-delay: 1.04s;
  }
}
@-webkit-keyframes load {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0.2;
  }
}
</style>
